<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数</title>
</head>
<body>
<script>
    //1.JS通过function关键字定义函数
    function f1() {
        console.log('f1被调用了')
    }

    f1();
    f1();

    function f2(n) {
        console.log('f2被调用了！')
        console.log(n)
    }

    f2(10);
    f2(false);
    f2('哈哈哈');

    function f3(a, b) {
        console.log(a + b);
    }

    f3(1, 2);
    f3(1, 2, 5);
    f3(5);

    function f4(x, y) {
        return x + y;
    }

    var f = f4(4, 3);
    console.log(f)
    console.log(f4(5, 6))


    var f5 = function () {
        console.log('f5')
    }
    f5();+量保存了函数的全部内容的全部内容function{console.log}
    console.log(typeof f5)//function

    //箭头函数
    const f6 = () => {
        console.log('f6')
    }
    console.log(f6)
    console.log(typeof f6)
</script>
</body>
</html>